<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>Eclipse | lilei</title>
    <meta name="generator" content="VuePress 1.8.2">
    <link rel="icon" href="/images/icons/logo.png">
    <link rel="apple-touch-icon" href="/images/icons/logo.png">
    <link rel="manifest" href="/manifest.json">
    <script type="text/javascript" src="/assets/js/load.js"></script>
    <meta name="description" content="Title: ${enclosing_method}">
    <meta name="twitter:title" content="Eclipse">
    <meta name="twitter:description" content="Title: ${enclosing_method}">
    <meta name="twitter:card" content="summary">
    <meta name="twitter:url" content="http://www.lileiblog.xyz/IDE/Eclipse.html">
    <meta property="og:type" content="article">
    <meta property="og:title" content="Eclipse">
    <meta property="og:description" content="Title: ${enclosing_method}">
    <meta property="og:url" content="http://www.lileiblog.xyz/IDE/Eclipse.html">
    <meta property="og:site_name" content="lilei">
    <meta itemprop="name" content="Eclipse">
    <meta itemprop="description" content="Title: ${enclosing_method}">
    <meta name="theme-color" content="#3eaf7c">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="msapplication-TileImage" content="/images/icons/logo.png">
    <meta name="msapplication-TileColor" content="#ffffff">
    <meta name="keywords" content="lilei,vue,vuepress,vuepress-theme,theme,主题,vuepress主题,blog
        ,vuepress-blog,java,python,shell,sql,golang,script,shell script,nginx,windows,去广告,androd,google drive
        ,one drive,idea,eclipse,git,小程序">
    <meta name="referrer" content="never">
    
    <link rel="preload" href="/assets/css/0.styles.8932179b.css" as="style"><link rel="preload" href="/assets/js/app.269009d6.js" as="script"><link rel="preload" href="/assets/js/3.974b9720.js" as="script"><link rel="preload" href="/assets/js/14.314fae34.js" as="script"><link rel="prefetch" href="/assets/js/10.5915e99b.js"><link rel="prefetch" href="/assets/js/11.ff732762.js"><link rel="prefetch" href="/assets/js/12.8bb86d91.js"><link rel="prefetch" href="/assets/js/13.18bde5b0.js"><link rel="prefetch" href="/assets/js/15.0a4ff48f.js"><link rel="prefetch" href="/assets/js/16.ffaf1503.js"><link rel="prefetch" href="/assets/js/17.49a31a6e.js"><link rel="prefetch" href="/assets/js/18.7e6443bf.js"><link rel="prefetch" href="/assets/js/19.6880cc9a.js"><link rel="prefetch" href="/assets/js/20.1fb3f255.js"><link rel="prefetch" href="/assets/js/21.0cd39eea.js"><link rel="prefetch" href="/assets/js/22.392d85cb.js"><link rel="prefetch" href="/assets/js/23.f50adb15.js"><link rel="prefetch" href="/assets/js/24.43e324e1.js"><link rel="prefetch" href="/assets/js/25.e3663205.js"><link rel="prefetch" href="/assets/js/26.da141fb8.js"><link rel="prefetch" href="/assets/js/27.6c05235a.js"><link rel="prefetch" href="/assets/js/28.c124245a.js"><link rel="prefetch" href="/assets/js/29.d185870d.js"><link rel="prefetch" href="/assets/js/30.8587d422.js"><link rel="prefetch" href="/assets/js/31.dc382b56.js"><link rel="prefetch" href="/assets/js/32.20ba32e9.js"><link rel="prefetch" href="/assets/js/33.6ecd7de9.js"><link rel="prefetch" href="/assets/js/34.2b91c13a.js"><link rel="prefetch" href="/assets/js/35.66ed0733.js"><link rel="prefetch" href="/assets/js/36.ce7bca84.js"><link rel="prefetch" href="/assets/js/37.d00bb5ac.js"><link rel="prefetch" href="/assets/js/38.c3ecbb6f.js"><link rel="prefetch" href="/assets/js/39.308f4175.js"><link rel="prefetch" href="/assets/js/4.520f6ecc.js"><link rel="prefetch" href="/assets/js/40.f4b98bc2.js"><link rel="prefetch" href="/assets/js/41.95fae64f.js"><link rel="prefetch" href="/assets/js/42.fe4f877b.js"><link rel="prefetch" href="/assets/js/43.ca8f222e.js"><link rel="prefetch" href="/assets/js/44.4d4ee79e.js"><link rel="prefetch" href="/assets/js/45.79178b33.js"><link rel="prefetch" href="/assets/js/46.c3817d0b.js"><link rel="prefetch" href="/assets/js/47.b8252443.js"><link rel="prefetch" href="/assets/js/48.df9d5d3b.js"><link rel="prefetch" href="/assets/js/49.d812fdb2.js"><link rel="prefetch" href="/assets/js/5.f1a24a16.js"><link rel="prefetch" href="/assets/js/50.55cfcaa8.js"><link rel="prefetch" href="/assets/js/51.b8608b02.js"><link rel="prefetch" href="/assets/js/52.52c5e00d.js"><link rel="prefetch" href="/assets/js/53.3a9bd5fb.js"><link rel="prefetch" href="/assets/js/54.a4240c13.js"><link rel="prefetch" href="/assets/js/55.01c4b876.js"><link rel="prefetch" href="/assets/js/56.f29549a3.js"><link rel="prefetch" href="/assets/js/57.01438a04.js"><link rel="prefetch" href="/assets/js/58.29bb4626.js"><link rel="prefetch" href="/assets/js/59.e8b89408.js"><link rel="prefetch" href="/assets/js/6.8c478b39.js"><link rel="prefetch" href="/assets/js/60.bedb5381.js"><link rel="prefetch" href="/assets/js/61.bdfbe584.js"><link rel="prefetch" href="/assets/js/62.cb825d1a.js"><link rel="prefetch" href="/assets/js/63.a9516572.js"><link rel="prefetch" href="/assets/js/64.aa854ed7.js"><link rel="prefetch" href="/assets/js/65.285f883d.js"><link rel="prefetch" href="/assets/js/66.12849f37.js"><link rel="prefetch" href="/assets/js/67.c18b00e4.js"><link rel="prefetch" href="/assets/js/68.fa59daa9.js"><link rel="prefetch" href="/assets/js/69.e9d5dda4.js"><link rel="prefetch" href="/assets/js/7.cfb0d0ea.js"><link rel="prefetch" href="/assets/js/70.db126cce.js"><link rel="prefetch" href="/assets/js/71.6acb04cd.js"><link rel="prefetch" href="/assets/js/72.7ff0ab11.js"><link rel="prefetch" href="/assets/js/73.9a66da79.js"><link rel="prefetch" href="/assets/js/74.0a38a030.js"><link rel="prefetch" href="/assets/js/75.7b32dbb3.js"><link rel="prefetch" href="/assets/js/8.cb9c08e5.js"><link rel="prefetch" href="/assets/js/9.ad652cfe.js"><link rel="prefetch" href="/assets/js/vendors~flowchart.110a1065.js">
    <link rel="stylesheet" href="/assets/css/0.styles.8932179b.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/" class="home-link router-link-active"><img src="/images/icons/logo.png" alt="lilei" class="logo"> <span class="site-name can-hide">lilei</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/Form/" class="nav-link">
  Form
</a></div><div class="nav-item"><a href="/IDE/" class="nav-link router-link-active">
  IDE
</a></div><div class="nav-item"><a href="/Java/" class="nav-link">
  Java
</a></div><div class="nav-item"><a href="/Other/" class="nav-link">
  Other
</a></div><div class="nav-item"><a href="/Python/" class="nav-link">
  Python
</a></div><div class="nav-item"><a href="/SQL/" class="nav-link">
  SQL
</a></div><div class="nav-item"><a href="/Shell/" class="nav-link">
  Shell
</a></div><div class="nav-item"><a href="/System/" class="nav-link">
  System
</a></div> <a href="https://github.com/woytu/notes-vuepress" target="_blank" rel="noopener noreferrer" class="repo-link">
    GitHub
    <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="/Form/" class="nav-link">
  Form
</a></div><div class="nav-item"><a href="/IDE/" class="nav-link router-link-active">
  IDE
</a></div><div class="nav-item"><a href="/Java/" class="nav-link">
  Java
</a></div><div class="nav-item"><a href="/Other/" class="nav-link">
  Other
</a></div><div class="nav-item"><a href="/Python/" class="nav-link">
  Python
</a></div><div class="nav-item"><a href="/SQL/" class="nav-link">
  SQL
</a></div><div class="nav-item"><a href="/Shell/" class="nav-link">
  Shell
</a></div><div class="nav-item"><a href="/System/" class="nav-link">
  System
</a></div> <a href="https://github.com/woytu/notes-vuepress" target="_blank" rel="noopener noreferrer" class="repo-link">
    GitHub
    <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></nav>  <ul class="sidebar-links"><li><section class="sidebar-group depth-0"><p class="sidebar-heading open"><span>IDE</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/IDE/" aria-current="page" class="sidebar-link">IDE</a></li><li><a href="/IDE/Chrome.html" class="sidebar-link">Chrome</a></li><li><a href="/IDE/Eclipse.html" aria-current="page" class="active sidebar-link">Eclipse</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/IDE/Eclipse.html#flag" class="sidebar-link">Flag</a></li><li class="sidebar-sub-header"><a href="/IDE/Eclipse.html#安装java-ee开发插件" class="sidebar-link">安装Java EE开发插件</a></li><li class="sidebar-sub-header"><a href="/IDE/Eclipse.html#字体大小和背景色" class="sidebar-link">字体大小和背景色</a></li><li class="sidebar-sub-header"><a href="/IDE/Eclipse.html#代码格式化" class="sidebar-link">代码格式化</a></li><li class="sidebar-sub-header"><a href="/IDE/Eclipse.html#自动提示" class="sidebar-link">自动提示</a></li><li class="sidebar-sub-header"><a href="/IDE/Eclipse.html#显示内存" class="sidebar-link">显示内存</a></li><li class="sidebar-sub-header"><a href="/IDE/Eclipse.html#解决卡死现象" class="sidebar-link">解决卡死现象</a></li><li class="sidebar-sub-header"><a href="/IDE/Eclipse.html#清除workspace历史记录" class="sidebar-link">清除workspace历史记录</a></li><li class="sidebar-sub-header"><a href="/IDE/Eclipse.html#调整运行内存" class="sidebar-link">调整运行内存</a></li><li class="sidebar-sub-header"><a href="/IDE/Eclipse.html#设置编码格式" class="sidebar-link">设置编码格式</a></li><li class="sidebar-sub-header"><a href="/IDE/Eclipse.html#设置tab为空格" class="sidebar-link">设置Tab为空格</a></li><li class="sidebar-sub-header"><a href="/IDE/Eclipse.html#快捷键设置" class="sidebar-link">快捷键设置</a></li><li class="sidebar-sub-header"><a href="/IDE/Eclipse.html#自动导包" class="sidebar-link">自动导包</a></li><li class="sidebar-sub-header"><a href="/IDE/Eclipse.html#右键new选项" class="sidebar-link">右键new选项</a></li><li class="sidebar-sub-header"><a href="/IDE/Eclipse.html#注释模板" class="sidebar-link">注释模板</a></li><li class="sidebar-sub-header"><a href="/IDE/Eclipse.html#插件安装使用" class="sidebar-link">插件安装使用</a></li></ul></li><li><a href="/IDE/Git使用.html" class="sidebar-link">Git使用</a></li><li><a href="/IDE/Git安装与问题.html" class="sidebar-link">Git安装与问题</a></li><li><a href="/IDE/Git服务.html" class="sidebar-link">Git服务</a></li><li><a href="/IDE/IDEA使用.html" class="sidebar-link">IDEA使用</a></li><li><a href="/IDE/IDEA插件.html" class="sidebar-link">IDEA插件</a></li><li><a href="/IDE/IDEA设置.html" class="sidebar-link">IDEA设置</a></li><li><a href="/IDE/TextEditor.html" class="sidebar-link">TextTditor</a></li><li><a href="/IDE/VisualStudioCode.html" class="sidebar-link">VisualStudioCode</a></li></ul></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="eclipse"><a href="#eclipse" class="header-anchor">#</a> Eclipse</h1> <p></p><div class="table-of-contents"><ul><li><a href="#flag">Flag</a></li><li><a href="#安装java-ee开发插件">安装Java EE开发插件</a></li><li><a href="#字体大小和背景色">字体大小和背景色</a></li><li><a href="#代码格式化">代码格式化</a></li><li><a href="#自动提示">自动提示</a></li><li><a href="#显示内存">显示内存</a></li><li><a href="#解决卡死现象">解决卡死现象</a></li><li><a href="#清除workspace历史记录">清除workspace历史记录</a></li><li><a href="#调整运行内存">调整运行内存</a></li><li><a href="#设置编码格式">设置编码格式</a></li><li><a href="#设置tab为空格">设置Tab为空格</a></li><li><a href="#快捷键设置">快捷键设置</a></li><li><a href="#自动导包">自动导包</a></li><li><a href="#右键new选项">右键new选项</a><ul><li><a href="#sun内部包不存在">SUN内部包不存在</a></li></ul></li><li><a href="#注释模板">注释模板</a></li><li><a href="#插件安装使用">插件安装使用</a></li></ul></div><p></p> <h2 id="flag"><a href="#flag" class="header-anchor">#</a> Flag</h2> <ul><li><a href="https://github.com/eclipse/eclipse" target="_blank" rel="noopener noreferrer">https://github.com/eclipse/eclipse<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a> <ul><li><a href="https://www.eclipse.org/ide" target="_blank" rel="noopener noreferrer">https://www.eclipse.org/ide<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li><a href="http://www.eclipse.org/downloads/packages" target="_blank" rel="noopener noreferrer">http://www.eclipse.org/downloads/packages<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li><a href="https://github.com/eclipse/wildwebdeveloper" target="_blank" rel="noopener noreferrer">https://github.com/eclipse/wildwebdeveloper<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a> <ul><li>Mars之后版本不再集成支持JavaScript需要安装插件，参考<a href="https://marketplace.eclipse.org/content/tern-eclipse-ide" target="_blank" rel="noopener noreferrer">Tern Eclipse IDE<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul></li></ul></li></ul> <ul><li><a href="https://blog.csdn.net/mp9105/article/details/93343403" target="_blank" rel="noopener noreferrer">单行注释自动靠左<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li><a href="https://www.cnblogs.com/ZeGod/p/10114049.html" target="_blank" rel="noopener noreferrer">Eclipse的Debug各种视图介绍<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li><a href="https://blog.csdn.net/u013600314/article/details/85262257" target="_blank" rel="noopener noreferrer">STS(eclipse)中文注释错位、缩进、被放大BUG解决<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul> <ul><li><code>Windows</code> -&gt; <code>Preference</code> -&gt; <code>General</code> -&gt; <code>Workspace</code> --&gt; <code>Build</code> <ul><li><code>Save automatically before manual build</code> 在手动构建之前自动保存</li> <li><code>Build automatically</code>（同<code>Project</code>菜单下的按钮） 自动编译</li></ul></li></ul> <blockquote><p>创建<code>Dynamic Web Project</code>项目结构静态资源目录为：<code>WebContent</code>/<code>WebRoot</code>，idea创建的为<code>web</code></p></blockquote> <p><strong>查看类类图及继承关系</strong></p> <ul><li>选中类，右键然后有以下选项
<ul><li><code>Open Declaration</code> <kdb>F3</kdb></li> <li><code>Open Type Hierarchy</code> <kdb>F4</kdb> 打开类层次结构查看窗口，显示包括它的父类和子类
<ul><li><code>Show the Subtype Hierarchy</code> 只查看子类</li> <li><code>Show the Supertype Hierarchy</code> 只查看父类</li></ul></li> <li><code>Open Call Hierarchy</code> <kdb>Ctrl</kdb>+<kdb>Alt</kdb>+<kdb>H</kdb></li> <li><code>Show in Breadcrumb</code> <kdb>Alt</kdb>+<kdb>Shift</kdb>+<kdb>B</kdb> 面包屑导航</li> <li><code>Quick Outline</code> <kdb>Ctrl</kdb>+<kdb>O</kdb></li> <li><code>Quick Type Hierarchy</code> <kdb>Ctrl</kdb>+<kdb>T</kdb>  打开类层次结构查看弹窗，显示包括它的父类和子类</li></ul></li></ul> <p><strong>快捷生成调用实例set方法</strong></p> <ol><li>进入实例类，打开<code>Type Hierarchy</code>视图并在视图中选中所有set方法复制，快捷键<kbd>F4</kbd></li> <li>使用以下方法生成</li></ol> <div class="language-java extra-class"><pre class="language-java"><code><span class="token comment">/**
 * 生成实例所有set调用方法并复制到剪贴板
 * 
 * @param clazz
 */</span>
<span class="token keyword">public</span> <span class="token keyword">static</span> <span class="token keyword">void</span> <span class="token function">createInstanceSetter</span><span class="token punctuation">(</span><span class="token class-name">Class</span><span class="token generics"><span class="token punctuation">&lt;</span><span class="token operator">?</span><span class="token punctuation">&gt;</span></span> clazz<span class="token punctuation">)</span> <span class="token punctuation">{</span>
   <span class="token class-name">String</span> name <span class="token operator">=</span> clazz<span class="token punctuation">.</span><span class="token function">getSimpleName</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
   <span class="token class-name">String</span> subName <span class="token operator">=</span> name<span class="token punctuation">.</span><span class="token function">substring</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">,</span> <span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
   name <span class="token operator">=</span> name<span class="token punctuation">.</span><span class="token function">replace</span><span class="token punctuation">(</span>subName<span class="token punctuation">,</span> subName<span class="token punctuation">.</span><span class="token function">toLowerCase</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
   <span class="token class-name">StringJoiner</span> joiner <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">StringJoiner</span><span class="token punctuation">(</span><span class="token class-name">System</span><span class="token punctuation">.</span><span class="token function">lineSeparator</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token comment">// 获取系统换行符</span>
   <span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token class-name">Method</span> m <span class="token operator">:</span> clazz<span class="token punctuation">.</span><span class="token function">getMethods</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
      <span class="token keyword">if</span> <span class="token punctuation">(</span>m<span class="token punctuation">.</span><span class="token function">getName</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">startsWith</span><span class="token punctuation">(</span><span class="token string">&quot;set&quot;</span><span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
            joiner<span class="token punctuation">.</span><span class="token function">add</span><span class="token punctuation">(</span>name <span class="token operator">+</span> <span class="token string">&quot;.&quot;</span> <span class="token operator">+</span> m<span class="token punctuation">.</span><span class="token function">getName</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">+</span> <span class="token string">&quot;();&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
      <span class="token punctuation">}</span>
   <span class="token punctuation">}</span>
   <span class="token class-name">String</span> <span class="token class-name">Content</span> <span class="token operator">=</span> joiner<span class="token punctuation">.</span><span class="token function">toString</span><span class="token punctuation">(</span><span class="token punctuation">)</span>；
   <span class="token comment">// 封装文本内容</span>
   <span class="token class-name">Transferable</span> trans <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">StringSelection</span><span class="token punctuation">(</span><span class="token class-name">Content</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
   <span class="token comment">// 把文本内容设置到系统剪贴板</span>
   <span class="token keyword">if</span> <span class="token punctuation">(</span>trans<span class="token punctuation">.</span><span class="token function">isDataFlavorSupported</span><span class="token punctuation">(</span><span class="token class-name">DataFlavor</span><span class="token punctuation">.</span>stringFlavor<span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
      <span class="token comment">// 获取系统剪贴板</span>
      <span class="token class-name">Clipboard</span> clipboard <span class="token operator">=</span> <span class="token class-name">Toolkit</span><span class="token punctuation">.</span><span class="token function">getDefaultToolkit</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">getSystemClipboard</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
      clipboard<span class="token punctuation">.</span><span class="token function">setContents</span><span class="token punctuation">(</span>trans<span class="token punctuation">,</span> <span class="token keyword">null</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
      <span class="token class-name">System</span><span class="token punctuation">.</span>out<span class="token punctuation">.</span><span class="token function">println</span><span class="token punctuation">(</span><span class="token class-name">Content</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
   <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre></div><p><strong>xml文件头部文件报错</strong></p> <ul><li><code>%USERPROFILE%\.lemminx\cache\头部文件的链接地址路径</code></li></ul> <blockquote><p>示例：链接地址为<code>http://mybatis.org/dtd/mybatis-3-config.dtd</code>
文件路径为<code>%USERPROFILE%\.lemminx\cache\http\mybatis.org\dtd\mybatis-3-config.dtd</code></p></blockquote> <p><strong>Clean Up、Format、Clean</strong></p> <ul><li>顶部菜单 -&gt; <code>Source</code> -&gt; <code>Clean Up</code> 针对代码的内容进行整理，比如去除无用代码或者引用包。</li> <li>顶部菜单 -&gt; <code>Source</code> -&gt; <code>Organize Imports</code> 去除单个类中无用的引用包信息<kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>O</kbd></li> <li>顶部菜单 -&gt; <code>Source</code> -&gt; <code>Format</code> 对代码的格式进行整理，比如设置了<code>Table</code>为4个空格，那么将会转换。</li> <li>顶部菜单 -&gt; <code>Project</code> -&gt; <code>Clean</code> 根据当前项目情况更新<code>.classpath</code>文件的内容，强制检查已安装插件，清除编译信息，重新部署项目。</li> <li><code>Servers</code> -&gt; <code>Clean</code> 是指原先编译到tomcat服务器上的程序，先清除掉，然后再重新编译。</li> <li><code>Servers</code> -&gt; <code>Clean Tomcat Work Directory...</code> 将已发布项目中存放jsp转译后的class文件的work目录删除</li></ul> <p><strong>项目显示结构</strong></p> <ul><li><code>Windows</code> -&gt; <code>Show View</code> -&gt; <code>Other</code> -&gt; 搜索 <code>Package Exploer</code></li></ul> <p><strong>WebStorm保存后跳过Eclipse自动同步到Tomcat</strong></p> <ul><li><code>File</code> -&gt; <code>Settings</code> -&gt; <code>Build, Execution, Deployment</code> -&gt; <code>Deployment</code> （或顶部菜单 <code>Tools</code> -&gt; <code>Deployment</code> -&gt; <code>Configuration</code>）</li> <li>配置一个应用：右侧点击<code>+</code>号 -&gt; 点击<code>Local or mounted floder</code> -&gt; 输入自定义名称
<ul><li>右侧<code>Connection</code>页签
<ul><li><code>Floder</code> 选择Eclipse配置的Tomcat部署的当前项目路径</li></ul></li> <li>右侧<code>Mappings</code>页签
<ul><li><code>Local path</code> 需要部署的文件路径（相对项目根目录）</li> <li><code>Deployment path</code> 把<code>Local path</code>部署到指定路径（相对<code>Floder</code>的路径）一般为<code>\</code></li></ul></li></ul></li> <li>点击顶部菜单 <code>Tools</code> -&gt; <code>Deployment</code> -&gt; 选择 <code>Automatic Upload(always)</code> 自动构建</li></ul> <blockquote><p>其实原理很简单：就是在保存源码文件的同时，实时编译构建同步的时候跳过Eclipse，直接同步到Tomcat部署的当前项目目录</p></blockquote> <h2 id="安装java-ee开发插件"><a href="#安装java-ee开发插件" class="header-anchor">#</a> 安装Java EE开发插件</h2> <blockquote><p>默认没有 <code>Dynamic Web Project</code></p></blockquote> <ul><li><code>Help</code> -&gt; <code>Install New Software</code> -&gt; <code>Work with</code> 选择 <code>All available Sites</code> -&gt;
勾选 <code>Web,XML,Java EE and OSGi Enterprise Development</code> -&gt; <code>Next</code> -&gt; <code>I accept the terms of the licence agreement</code></li></ul> <h2 id="字体大小和背景色"><a href="#字体大小和背景色" class="header-anchor">#</a> 字体大小和背景色</h2> <ul><li>调节控制台字体大小 <code>Window</code> -&gt; <code>Preferences</code> -&gt; <code>General</code> -&gt; <code>Appearance</code> -&gt; <code>Colors and Fonts</code> -&gt; <code>Basic</code> -&gt; <code>Text Font</code> -&gt; <code>Edit</code></li> <li>调节主窗口字体大小 <code>Window</code> -&gt; <code>Preferences</code> -&gt; <code>General</code> -&gt; <code>Appearance</code> -&gt; <code>Colors and Fonts</code> -&gt; <code>Java</code> -&gt; <code>Java Editor Text Font</code> -&gt; <code>Edit</code></li> <li>设置眼睛保护色 <code>Window</code> -&gt; <code>Prefences</code> -&gt; <code>General</code> -&gt; <code>Editors</code> -&gt; <code>Text Editors</code> -&gt; <code>Appearance color optins</code></li></ul> <h2 id="代码格式化"><a href="#代码格式化" class="header-anchor">#</a> 代码格式化</h2> <ul><li><a href="https://help.eclipse.org/2020-12/index.jsp?topic=%2Forg.eclipse.platform.doc.user%2Freference%2Fref-texteditorprefs.htm" target="_blank" rel="noopener noreferrer">General &gt; Editors &gt; Text Editors<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul> <p><strong>垂直标尺</strong></p> <ul><li><code>Window</code> -&gt; <code>Preferences</code> -&gt; <code>General</code> -&gt; <code>Editors</code> -&gt; <code>Text Editors</code> -&gt; <code>Show Print Margin</code> <ul><li><code>Print margin column</code> 行宽</li> <li><code>Allow editors to override the margin column</code></li></ul></li></ul> <p><strong>Java 格式化</strong></p> <ul><li><code>Window</code> -&gt; <code>Preferences</code> -&gt; <code>Java</code> -&gt; <code>Code Style</code> -&gt; <code>Formatter</code> -&gt; <code>New</code> -&gt; <code>Edit</code> <ul><li>-&gt; <code>Line Wrapping</code> <ul><li><code>Maximum Line width</code> 控制每行的最大字符数</li> <li><code>Set line width for preview window</code> 设置预览窗口的线宽</li> <li>-&gt; <code>Wrapping settings</code> -&gt; <code>Binary expressions</code> -&gt; <code>Line wrapping policy</code> -&gt; <code>Wrap all elements,every elements on a new line</code> 将所有元素换行，每个元素都换行</li> <li>-&gt; <code>Function Calls</code> -&gt; <code>Qualified invocations</code> -&gt; <code>Wrap all elements,every elements on a new line</code> 连续调用不换行</li> <li><code>Never join already wrapped lines</code> 不格式化已换行的</li></ul></li> <li>-&gt; <code>Comments</code> 注释
<ul><li><code>Maximum line width for comments</code> 注释的最大行宽
<ul><li><code>Count width from comment's starting position</code> 从注释的开始位置计算宽度</li></ul></li> <li><code>Enable Javadoc comment formatting</code> 启用Javadoc注释格式</li> <li><code>Enable block comment formatting</code> 启用块注释格式（每一行以<code>*</code>开头）</li> <li><code>Enable line comment formatting</code> 启用行注释格式
<ul><li><code>Format line comments on first column</code> 格式化代码与注释符之间的间距</li></ul></li> <li><code>Enable header comment formatting</code> 启用标题注释格式</li> <li><code>Preserve whitespace between code and line comments</code> 保留代码和行注释之间的空格</li> <li><code>Never indent line comments on first column</code> 切勿在第一列缩进行注释</li> <li><code>Never indent block comments on first column</code> 切勿在第一列缩进块注释</li> <li><code>Never join lines</code> 从不连接线</li></ul></li></ul></li></ul> <p><strong>JavaScript 格式化</strong></p> <ul><li><code>Window</code> -&gt; <code>Preferences</code> -&gt; <code>HTML Files</code> -&gt; <code>Client-side JavaScript</code> -&gt; <code>Code Style</code> -&gt; <code>Formatter</code> -&gt; <code>New</code> -&gt; <code>Edit</code> <ul><li>-&gt; <code>Line Wrapping</code> 行宽
<ul><li><code>Maximum Line width</code></li> <li><code>Set line width for preview window</code> 设置预览窗口的线宽</li></ul></li> <li>-&gt; <code>Comments</code> <ul><li><code>Maximum line width for comments</code></li></ul></li></ul></li></ul> <p><strong>JSP|HTML|CSS 格式化</strong></p> <ul><li><code>Window</code> -&gt; <code>Preferences</code> -&gt; <code>Web</code> -&gt; <code>HTML Files</code> / <code>CSS Files</code> -&gt; <code>Editor</code> <ul><li><code>Line width</code> 行宽</li> <li><code>Inline Elements</code> 选中所有 -&gt; <code>Remove</code></li> <li><code>Indent using spaces</code> 缩进使用空格</li> <li><code>Indentation size</code> 缩进使用多少个字符</li></ul></li></ul> <p><strong>XML</strong></p> <ul><li><code>Window</code> -&gt; <code>Preferences</code> -&gt; <code>Web</code> -&gt; <code>XML</code> -&gt; <code>XML Files</code> -&gt; <code>Editor</code> <ul><li><code>Formatting</code> -&gt; <code>Line width</code> 行宽</li></ul></li></ul> <h2 id="自动提示"><a href="#自动提示" class="header-anchor">#</a> 自动提示</h2> <ul><li><a href="https://xienaoban.github.io/posts/32764" target="_blank" rel="noopener noreferrer">Eclipse 开启代码提示与关闭变量命名补全<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul> <ul><li><code>Window</code> -&gt; <code>Preferences</code> -&gt; <code>Java</code> -&gt; <code>Editor</code> -&gt; <code>Content Assist</code> <ul><li><code>Auto Activation</code> 下的<code>Auto Activation triggers for java</code> 填入 <code>._abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ</code></li> <li>解决输入<code>=</code>或<code>;</code>变量自动补全问题：勾选 <code>Disable insertion triggers except 'Enter'</code> (按<kbd>Enter</kbd>键才自动补全)</li></ul></li> <li>XML自动补全 <code>Windows</code> -&gt; <code>preferance</code> -&gt; <code>XML</code> -&gt; <code>XML Files</code> -&gt; <code>Editor</code> -&gt; <code>Content Assist</code> -&gt; <code>Auto Activation</code>下面的
<code>Prompt when these characters are inserted</code> 填入 <code>&lt;=:abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ</code>（注意后面有一个空格）</li></ul> <ul><li>解决按下<code>@</code>不提示注解：<code>Window</code> -&gt; <code>Preferences</code> -&gt; <code>Java</code> -&gt; <code>Editor</code> -&gt; <code>Content Assist</code> -&gt; <code>Advanced</code> 下把<code>java Proposals</code>勾上</li> <li><code>Enable non-blocking completion(does not affect open editors)</code> 启用非阻塞完成（不影响打开的编辑器）</li></ul> <h2 id="显示内存"><a href="#显示内存" class="header-anchor">#</a> 显示内存</h2> <blockquote><p>在eclipse中打开heap状态 <code>Windows</code> -&gt; <code>Preference</code> -&gt; <code>General</code> –&gt; 勾选<code>show heap status</code></p></blockquote> <h2 id="解决卡死现象"><a href="#解决卡死现象" class="header-anchor">#</a> 解决卡死现象</h2> <blockquote><p>Eclipse中jsp、js文件编辑时，卡死现象解决</p></blockquote> <ul><li>取消验证 <code>Windows</code> -&gt; <code>Preference</code> –&gt; <code>validation</code> -&gt; 点击<code>Disable All</code>然后勾选<code>classpath dependency Validator</code> <ul><li><code>Allow projects to override these preference settings</code> 允许项目覆盖这些首选项设置</li> <li><code>Suspend all validators</code> 暂停所有验证器</li> <li><code>Save all modified resources automatically prior to validating</code> 验证之前自动保存所有修改的资源</li> <li><code>Show a confirmation dialog when performing manual validations</code> 执行手动验证时显示确认对话框</li></ul></li> <li>关闭拼写检查 <code>Windows</code> -&gt; <code>Preference</code> -&gt; <code>General</code> –&gt; <code>editors</code> -&gt; <code>Text Editors</code> -&gt; <code>spelling</code></li> <li>选中项目点击右键 -&gt; <code>Properties</code> -&gt; <code>Builders</code> 在右边取消勾选除<code>Java Builder</code>以外的其他选项</li></ul> <h2 id="清除workspace历史记录"><a href="#清除workspace历史记录" class="header-anchor">#</a> 清除workspace历史记录</h2> <ul><li><code>Windows</code> -&gt; <code>Preference</code> -&gt; <code>General</code> –&gt; <code>Startup and Shuodown</code> -&gt; <code>Prompt for workspace on startup</code>/<code>Workspaces</code></li> <li>编辑eclipse下的<code>/configuration/.settings/org.eclipse.ui.ide.prefs</code> -&gt; <code>RECENT_WORKSPACES</code> 删除不需要的目录，以<code>\n</code>分隔</li></ul> <h2 id="调整运行内存"><a href="#调整运行内存" class="header-anchor">#</a> 调整运行内存</h2> <ul><li>在eclipse的安装目录下编辑<code>eclipse.ini</code>文件</li></ul> <p><a href="/Java/Tomcat.html#四">JVM参数设置</a></p> <div class="language-conf extra-class"><pre class="language-text"><code># JDK8以下
-Xms128M -Xmx512M -XX:PermSize=64M -XX:MaxPermSize=128M
# JDK8
-Xms128M -Xmx512M -XX:MetaspaceSize=512m -XX:MaxMetaspaceSize=1024m
</code></pre></div><ul><li><code>-Xms128m</code> JVM初始分配的堆内存</li> <li><code>-Xmx512m</code> JVM最大允许分配的堆内存，按需分配</li> <li><code>-XX:PermSize=64M</code> JVM初始分配的非堆内存，JDK8之前</li> <li><code>-XX:MaxPermSize=128M</code> JVM最大允许分配的非堆内存，按需分配，JDK8之前</li> <li><code>-XX:MetaspaceSize=512m</code> 元数据，JDK8</li> <li><code>-XX:MaxMetaspaceSize=1024m</code> 最大元数据，JDK8</li></ul> <p><strong>设置JDK参数</strong></p> <ul><li><code>Windows</code> -&gt; <code>Preference</code> -&gt; <code>Java</code> –&gt; <code>Installed JREs</code> -&gt; 选中使用的JDK -&gt; <code>Edit</code> -&gt; <code>Default VM arguments</code></li></ul> <p><strong>设置Tomcat参数</strong></p> <ul><li><code>Run</code> -&gt; <code>Run Configurations</code> -&gt; 选中已添加的Tomcat -&gt; <code>Arguments</code> -&gt; 在<code>VM arguments</code>中换行添加</li></ul> <h2 id="设置编码格式"><a href="#设置编码格式" class="header-anchor">#</a> 设置编码格式</h2> <ul><li>设置工作空间编码 <code>Window</code> -&gt; <code>Preferences</code> -&gt; <code>General</code> -&gt; <code>Workspace</code> -&gt; <code>Text file encoding</code> -&gt; <code>Other</code>选择<code>UTF-8</code></li> <li>设置文档编码 <code>Window</code> -&gt; <code>Preferences</code> -&gt; <code>General</code> -&gt; <code>Content Type</code> -&gt; <code>Text</code> -&gt; <code>Default encoding</code>填入<code>UTF-8</code></li> <li>设置Web编码 <code>Window</code> -&gt; <code>Preferences</code> -&gt; <code>Web</code> -&gt; <code>CSS Files、HTML Files、JSP Files</code> -&gt; <code>Encoding</code>选择<code>ISO 10646/Unicode(UTF-8)</code></li> <li>设置项目的文档编码：选中项目右键 -&gt; <code>Properties</code> -&gt; <code>Resource</code> -&gt; <code>Other</code>选择<code>UTF-8</code></li></ul> <h2 id="设置tab为空格"><a href="#设置tab为空格" class="header-anchor">#</a> 设置Tab为空格</h2> <ul><li><code>Window</code> -&gt; <code>Preferences</code> -&gt; <code>General</code> -&gt; <code>Editors</code> -&gt; <code>Text Editors</code> -&gt; 勾选 <code>Insert spaces for tabs</code> <ul><li><code>Remove multiple spaces on backspace/delete</code> 删除退格键/删除多个空格</li></ul></li> <li><code>Window</code> -&gt; <code>Preference</code> -&gt; <code>Java</code> -&gt; <code>Code Style</code> -&gt; <code>Formatter</code> -&gt; <code>Edit</code> -&gt; <code>Indentation</code> -&gt; <code>Tab policy</code> 选择 <code>Spaces only</code></li></ul> <h2 id="快捷键设置"><a href="#快捷键设置" class="header-anchor">#</a> 快捷键设置</h2> <ul><li><code>Window</code> -&gt; <code>Preference</code> -&gt; <code>General</code> -&gt; <code>Keys</code></li> <li>设置复制一行 搜索<code>Ctrl+Alt+Down</code>或者<code>Copy Lines</code>即可修改</li></ul> <h2 id="自动导包"><a href="#自动导包" class="header-anchor">#</a> 自动导包</h2> <ul><li><code>Window</code> -&gt; <code>Preferences</code> -&gt; <code>Java</code> -&gt; <code>Editor</code> -&gt; <code>Save Actions</code> -&gt; 勾选 <code>Preform the selected actions on save</code> <ul><li><code>Format edited lines</code> 自动格式化修改的行</li> <li><code>Organize impots</code> 自动优化管理导入的包</li></ul></li></ul> <h2 id="右键new选项"><a href="#右键new选项" class="header-anchor">#</a> 右键new选项</h2> <ul><li><code>Window</code> -&gt; <code>Perspective</code> -&gt; <code>Customize Perspective...</code> -&gt; <code>Shortcuts</code>界面 -&gt; <code>Submenus</code>列中选中<code>Java</code></li></ul> <h3 id="sun内部包不存在"><a href="#sun内部包不存在" class="header-anchor">#</a> SUN内部包不存在</h3> <blockquote><p><code>sun.misc</code>（sun公司的内部方法，不属于JDK标准库范畴）包下的<code>BASE64Encoder</code>及<code>BASE64Decoder</code>来进行的</p></blockquote> <ul><li>项目右键 -&gt; <code>Build Path</code> -&gt; <code>Configure Build Path</code> -&gt; <code>Java Build Path</code> -&gt; <code>Libraries</code> -&gt; 展开<code>JRE System Libraries</code>
-&gt; 选中<code>Access rules</code> -&gt; 点击<code>Edit</code> -&gt; 弹窗点击<code>Add</code> -&gt; <code>Resolution</code>选择<code>Accessible</code> -&gt; <code>Rule Pattern</code>输入<code>**</code> -&gt; 点击<code>OK</code></li></ul> <h2 id="注释模板"><a href="#注释模板" class="header-anchor">#</a> 注释模板</h2> <ul><li><code>Window</code> -&gt; <code>Preference</code> -&gt; <code>Java</code> -&gt; <code>Code Style</code> -&gt; <code>Code Templates</code> <ul><li>展开<code>Comments</code> -&gt; 点击选中子项（<code>files</code>、<code>Types</code>） -&gt; <code>Pattern</code>填入注释模板</li> <li>勾选 <code>Automatically add comments for new methods and types</code> 自动为新方法和类型添加注释</li></ul></li> <li>注释的使用：输入<code>/**</code>然后回车自动出来</li></ul> <ul><li>创建新文件(New Java files)注释标签（在文件第一行）</li> <li>类型(Types)注释标签（在主体声明上）</li></ul> <div class="language-java extra-class"><pre class="language-java"><code><span class="token comment">/**
 * @Title: ${file_name}
 * @Package ${package_name}
 * @Description: 
 * @author: bajins.com
 * @date: ${date} ${time}
 * @version V1.0
 * @Copyright: ${year} bajins.com Inc. All rights reserved.
 */</span>
</code></pre></div><ul><li>字段(Fields)注释标签</li></ul> <div class="language-java extra-class"><pre class="language-java"><code> <span class="token comment">/**
  * @Fields ${field} : 
  * @author: bajins.com
  * @date: ${date} ${time}
  */</span>
</code></pre></div><ul><li>构造函数(Constructors)标签</li></ul> <div class="language-java extra-class"><pre class="language-java"><code><span class="token comment">/**
 * @Title: ${enclosing_type}
 * ${tags}
 * @author: bajins.com
 * @date: ${date} ${time}
 */</span>
</code></pre></div><ul><li>方法(Methods)标签</li></ul> <div class="language-java extra-class"><pre class="language-java"><code><span class="token comment">/**
 * 
 * ${tags} ${return_type}
 * @author: bajins.com
 * @date: ${date} ${time}
 */</span>
</code></pre></div><ul><li>覆盖方法(Overriding Methods)标签</li></ul> <div class="language-java extra-class"><pre class="language-java"><code><span class="token comment">/**
 * &lt;p&gt;Title: ${enclosing_method}&lt;/p&gt;
 * &lt;p&gt;Description: &lt;/p&gt;
 * ${tags}
 * ${see_to_overridden}
 * @author: bajins.com
 * @date: ${date} ${time}
 */</span>
</code></pre></div><ul><li>代表方法(Delegate Methods)标签</li></ul> <div class="language-java extra-class"><pre class="language-java"><code><span class="token comment">/**
 * ${tags}
 * ${see_to_target}
 * @author: bajins.com
 * @date: ${date} ${time}
 */</span>
</code></pre></div><ul><li>getter方法标签</li></ul> <div class="language-java extra-class"><pre class="language-java"><code><span class="token comment">/**
 * @Title: ${enclosing_method} &lt;BR&gt;
 * @Description: please write your description &lt;BR&gt;
 * @return: ${field_type} &lt;BR&gt;
 * @author: bajins.com
 * @date: ${date} ${time}
 */</span>
</code></pre></div><ul><li>setter方法标签</li></ul> <div class="language-java extra-class"><pre class="language-java"><code><span class="token comment">/**
 * @Title: ${enclosing_method} &lt;BR&gt;
 * @Description: please write your description &lt;BR&gt;
 * @return: ${field_type} &lt;BR&gt;
 * @author: bajins.com
 * @date: ${date} ${time}
 */</span>
</code></pre></div><h2 id="插件安装使用"><a href="#插件安装使用" class="header-anchor">#</a> 插件安装使用</h2> <blockquote><p>一般插件都有<code>plugins</code>和<code>features</code>两个文件夹，复制到eclipse安装目录即可</p></blockquote> <ul><li><code>-vmargs -DproxySet=true -DproxyHost=aProxyAddress -DproxyPort=aProxyPort</code> 启动代理参数</li></ul> <ul><li>SVN <a href="https://github.com/subclipse" target="_blank" rel="noopener noreferrer">https://github.com/subclipse<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul> <p><strong>反编译Decompiler</strong></p> <ul><li><code>Window</code> -&gt; <code>Preferences</code> -&gt; <code>General</code> -&gt; <code>Editors</code> -&gt; <code>File Associations</code> <ul><li>在<code>File types</code>选中<code>*.class</code> 或 <code>*.class without source</code></li> <li>在<code>Associated editors</code>选中<code>Class Decompiler Viewer</code>点击<code>Default</code></li></ul></li></ul> <ul><li><a href="https://github.com/ecd-plugin/ecd" target="_blank" rel="noopener noreferrer">https://github.com/ecd-plugin/ecd<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li><a href="https://github.com/iloveeclipse/plugins/wiki" target="_blank" rel="noopener noreferrer">https://github.com/iloveeclipse/plugins/wiki<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li><a href="https://github.com/java-decompiler/jd-eclipse" target="_blank" rel="noopener noreferrer">https://github.com/java-decompiler/jd-eclipse<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li><a href="https://github.com/cnfree/Eclipse-Class-Decompiler" target="_blank" rel="noopener noreferrer">https://github.com/cnfree/Eclipse-Class-Decompiler<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li><a href="https://github.com/helospark/import-jar-as-project" target="_blank" rel="noopener noreferrer">https://github.com/helospark/import-jar-as-project<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul> <p><strong>Cloud Toolkit</strong></p> <blockquote><p>帮助开发者更高效地开发、测试、诊断并部署应用。通过插件，可以将本地应用一键部署到任意服务器</p></blockquote> <ul><li><a href="http://toolkit.aliyun.com/eclipse" target="_blank" rel="noopener noreferrer">http://toolkit.aliyun.com/eclipse<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul></div> <footer class="page-edit"><div class="edit-link"><a href="https://github.com/woytu/notes-vuepress/edit/master//IDE/Eclipse.md" target="_blank" rel="noopener noreferrer">在 GitHub 上编辑此页</a> <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></div> <div class="last-updated"><span class="prefix">上次更新:</span> <span class="time">2021-07-15 16:41:16</span></div></footer> <div class="page-nav"><p class="inner"><span class="prev">
      ←
      <a href="/IDE/Chrome.html" class="prev">
        Chrome
      </a></span> <span class="next"><a href="/IDE/Git使用.html">
        Git使用
      </a>
      →
    </span></p></div> </main></div><div class="global-ui"><!----></div></div>
    <script src="/assets/js/app.269009d6.js" defer></script><script src="/assets/js/3.974b9720.js" defer></script><script src="/assets/js/14.314fae34.js" defer></script>
  </body>
</html>
